package utils

import (
	"crypto/hmac"
	"crypto/sha1"
	"encoding/hex"
)

/**
 * @Description
 * @Author huan.wang
 * @Date 2021/5/8 3:43 下午
 **/

func HmacSha(key string,data string) string {
	mac := hmac.New(sha1.New, []byte(key))
	mac.Write([]byte(data))
	res := hex.EncodeToString(mac.Sum(nil))
	return res
}